# 使用urllib作爬虫
import urllib.request

response = urllib.request.urlopen("http://www.baidu.com")

# print(response)

data = response.read().decode("utf-8")

# print(data)
# 返回请求的信息
print(response.info)

# 返回请求的状态
print(response.getcode())

url = "https://www.baidu.com/s?tn=02003390_43_hao_pg&isource=infinity&iname=baidu&itype=web&ie=utf-8&wd=%E4%BD%BF%E7%94%A8charles%E7%9A%84%E6%97%B6%E5%80%99%E8%AF%B4443%E5%80%8D%E5%8D%A0%E7%94%A8"
# 对上面的 url 进行解码
print(urllib.request.unquote(url))






